<template>
  <view class="my-search-container" :style="{'background-color': bgcolor }">
    <view class="my-search-box" :style="{'border-radius': radius + 'px'}" @click="searchBoxHandler">
      <uni-icons type="search" size="17"></uni-icons>
      <text class="text-search">搜索</text>
    </view>

  </view>
</template>

<script>
  export default {
    props: {
      //背景颜色
      bgcolor: {
        type: String,
        // 指定默认值
        default: '#aa0000'
      },
      // 圆角尺寸
      radius: {
        type: Number,
        default: 18
      }
    },
    name: "my-search",
    data() {
      return {

      };
    },
    methods: {
      searchBoxHandler() {
        this.$emit('click')
      }
    }
  }
</script>

<style lang="scss">
  .my-search-container {
    // background-color: #aa0000;
    height: 50px;
    display: flex;
    align-items: center;
    padding: 0 10px;

    .my-search-box {
      background-color: white;
      width: 100%;
      height: 40px;
      // line-height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      // text-align: center;
      // border-radius: 18px;

      .text-search {
        margin-left: 5px;
      }
    }
  }
</style>
